//
//  DViewController.m
//  Demo
//
//  Created by bupterambition on 07/12/2017.
//  Copyright (c) 2017 bupterambition. All rights reserved.
//

#import "DViewController.h"

@interface DViewController ()

@property (nonatomic, strong) UIView *testView;

@end

@implementation DViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (void)testInvocation:(NSUInteger)index {
    NSLog(@"%ld",index);
}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    [self.view addSubview:self.testView];
}

#pragma mark - Accessor




- (UIView *)testView {
	if (!_testView) {
        _testView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
        _testView.backgroundColor = [UIColor greenColor];
        _testView.center = self.view.center;
        UIBezierPath *bezierPath = [UIBezierPath bezierPathWithRoundedRect:CGRectInset(_testView.frame,5,5) cornerRadius:4];
        [UIColor.clearColor setFill];
        [UIColor.redColor setStroke];
        [bezierPath fill];
        [bezierPath stroke];
        _testView.layer.shadowPath = bezierPath.CGPath;
	}
	return _testView;
}
@end
